/*
 * Project: BoboDesignPattern
 * 
 * File Created at 2019年2月18日
 * 
 * Copyright 2012 Greenline.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Greenline Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Greenline.com.
 */
package memento;

/**
 * @Type DO
 * @Desc
 * @author 52489
 * @date 2019年2月18日
 * @Version V1.0
 */
public class DO {
    public static void main(String[] args) {
        CareTaker careTaker = new CareTaker();
        Emp emp = new Emp("波哥", "18", 20000);
        System.out.println(emp.getAge() + emp.getName() + emp.getSalary());

        careTaker.setEmpMemento(emp.memento()); // 备忘一次
        emp.setAge("20");
        emp.setName("波神");
        emp.setSalary(30000);
        System.out.println(emp.getAge() + emp.getName() + emp.getSalary());

        emp.recovery(careTaker.getEmpMemento());
        System.out.println(emp.getAge() + emp.getName() + emp.getSalary());
    }
}
